#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int Maxn=1e5+5;
int n,m,k;
struct edge{
	int u,v;
}e[Maxn];
int vis[Maxn],a[Maxn];




int f[Maxn];
int find(int x){return f[x]==x?x:f[x]=find(f[x]);}


vector<int>G[Maxn];

int son[Maxn],fa[Maxn],dep[Maxn];

int tot;
vector<int>res[Maxn];

int stk[Maxn];

inline void sol(int u,int v){
	++tot;
	if(dep[u]<dep[v])swap(u,v);
	while(dep[u]>dep[v]){
		res[tot].push_back(u);
		u=fa[u];
	}
	int tp=v;
	while(u!=v){
//		printf("[%d %d]:[%d,%d]\n",u,v,dep[u],dep[v]);
		res[tot].push_back(u);
		u=fa[u];v=fa[v];
	}res[tot].push_back(u);
	int len=0;
	v=tp;while(v!=u)stk[++len]=v,v=fa[v];
	while(len)res[tot].push_back(stk[len--]);
}
void dfs(int u,int v){
	fa[u]=v;dep[u]=dep[v]+1;
	if(vis[u])son[u]=u;
	for(int y:G[u]){
		if(y==v)continue;
		dfs(y,u);
		if(!son[u])son[u]=son[y];
		else if(son[y])sol(son[u],son[y]),son[u]=0;
	}
}

int main(){
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	n=read();m=read();k=read();
	for(int i=1;i<=m;i++)e[i]={read(),read()};
	for(int i=1;i<=k;i++)a[i]=read(),vis[a[i]]=1;
	
	for(int i=1;i<=n;i++)f[i]=i;
	
	
	for(int i=1;i<=m;i++){
		int u=find(e[i].u),v=find(e[i].v);
		if(u==v)continue;
		f[u]=v;
		G[e[i].u].push_back(e[i].v);
		G[e[i].v].push_back(e[i].u);
	}
	
	for(int i=1;i<=n;i++)if(find(i)==i)dfs(i,0);
	printf("%d\n",tot);
	for(int i=1;i<=tot;i++){
		printf("%d ",res[i].size());
		for(int j:res[i])printf("%d ",j);
		puts("");
	}
	return 0;
}
/*
8 7 4
1 2
2 3
3 4
2 5
5 6
3 7
7 8
1 4 6 8


5 4 4
1 2
2 3
4 2
5 2
1 3 4 5
*/
